/**
**************************************************************************************
*Palisma - Secrets of the Illuminati is an open-source 2D RPG                        *
*Copyright (C) 2006, Tony Sparks                                                     *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
#pragma once
#include <map>

#include "IEntity.h"
#include "PlayerConfig.h"
#include "MissionHolder.h"
#include "../script/LUA_Player.h"

class Melee;
class Shotgun;

struct buttons_t
{
    // buttons held down
    int buttons;

    int btnPressed;
    int btnReleased;
};

/**
==================================
Player - our hero
==================================
*/
class Player : public IEntity
{
public:
    Player(void);

    /** Get the Entity Type */
    int GetType() { return TYPE_PLAYER; };

    /** Update the Player */
    void Update( long dt);

    /** Apply a Trigger */
	void Trigger();

    /** Collide with another entity */
    bool CollideWith( IEntity* ent );

    /** Damage this entity */
	int Damage( int hit );

    /** Pick Up an Item */
    void PickUpItem(IEntity* ent);

    /** Buttons being pressed by the user */
    buttons_t *GetButtons() { return &buttons; };

    /** This is a player */
    bool IsPlayer() { return true; };

private:
    // check to user input
    buttons_t buttons;

    // the players config
    PlayerConfig       m_config;
    // TEMP - should move somewhere else!!!
    MissionDispatcher  m_dispatcher;
    // Bag of missions to accomplish
    MissionHolder      m_missions;


    // player always has melee
    Melee*             m_weaponMelee;
    Shotgun*           m_weaponShotgun; // test weapon
    // for scripting abilities
    friend LUA_Player;

public:
    virtual ~Player(void);
};

